package tester.entitys;

import java.util.ArrayList;
import java.util.List;

public class JdbcInfo {
    String url;
    String user;
    String pwd;
    String signature;
    List<TableInfo> tableInfos = new ArrayList<>();
    public JdbcInfo(String url, String user, String pwd, String signature) {
        this.url = url;
        this.user = user;
        this.pwd = pwd;
        this.signature = signature;
    }
    public JdbcInfo(String signature) {
        this.signature = signature;
    }
    public String getUrl() {
        return url;
    }
    public String getUser() {
        return user;
    }
    public String getPwd() {
        return pwd;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public void setUser(String user) {
        this.user = user;
    }
    public void setPwd(String pwd) {
        this.pwd = pwd;
    }
    public String getSign() {
        return signature;
    }

    public void setTable(String suffixStr) {
        String[] split = suffixStr.split(":");
        String tableName = split[0];
        String uniqueKey = split[1];
        tableInfos.add(new TableInfo(tableName, uniqueKey));
    }
    public List<TableInfo> getTableInfos() {
        return tableInfos;
    }
}
